import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {InventoryVO, InventoryQuery, ExportImportVo, GoodsVO, CustomerVo} from '@/api/wms/inventory/types';

/**
 * 库存汇总
 * @param query
 * @returns {*}
 */
export const listInventorySummary = (query?: InventoryQuery): AxiosPromise<InventoryVO[]> => {
  return request({
    url: '/wms/inventory/summary/list',
    method: 'get',
    params: query
  });
};

/**
 * 库存查询
 * @param query
 * @returns {*}
 */
export const listInventoryQuery = (query?: InventoryQuery): AxiosPromise<InventoryVO[]> => {
  return request({
    url: '/wms/inventory/query/list',
    method: 'get',
    params: query
  });
};

/**
 * 所有物品信息
 * @param query
 * @returns {*}
 */
export const listGoods = (query?: InventoryQuery): AxiosPromise<GoodsVO[]> => {
  return request({
    url: '/wms/inventory/goods/list',
    method: 'get',
    params: query
  });
};

/**
 * 所有客户信息
 * @param query
 * @returns {*}
 */
export const listCustomers = (query?: InventoryQuery): AxiosPromise<CustomerVo[]> => {
  return request({
    url: '/wms/inventory/customer/list',
    method: 'get',
    params: query
  });
};

/**
 * 库存查询
 * @param query
 * @returns {*}
 */
export const listInventoryExportImport = (query?: InventoryQuery): AxiosPromise<ExportImportVo[]> => {
  return request({
    url: '/wms/inventory/export-import/list',
    method: 'get',
    params: query
  });
};

/**
 * 入库流水单查询
 * @param query
 * @returns {*}
 */
export const listImportOrder = (query?: InventoryQuery): AxiosPromise<ExportImportVo[]> => {
  return request({
    url: '/wms/inventory/import-order/list',
    method: 'get',
    params: query
  });
};

/**
 * 出库流水单查询
 * @param query
 * @returns {*}
 */
export const listExportOrder = (query?: InventoryQuery): AxiosPromise<ExportImportVo[]> => {
  return request({
    url: '/wms/inventory/export-order/list',
    method: 'get',
    params: query
  });
};

